package com.zzw.hj15;

import java.util.Scanner;

/**
 * @Project: hw_java
 * @Description: 求int型正整数在内存中存储时1的个数
 * @Author: zzw
 */

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int num = in.nextInt();
        int count = 0;
        if (num == 0) {
            System.out.print(num);
        } else {
            // 除K取余法
            while (num > 0) {
                int rem = num % 2;
                if (rem == 1) {
                    count++;
                }
                num = num / 2;
            }
            System.out.print(count);
        }
    }
}